<?php
/**
 * Smarty plugin
 * @package Smarty
 * @subpackage Commercial core plugins
 */


/**
 * Smarty url_format modifier plugin
 *
 * Type:     modifier<br>
 * Name:     url_format<br>
 * Date:     Oct 20, 2008
 * Purpose:  unified formatting for urls
 * Input:    string
 * Example:  {$item.url|url_format}
 *           {'http://advanced.ya.ru/%23.html'|url_format}
 * @author   Alex Yaroshevich <qfox@ya.ru>
 * @version 0.1
 * @param string with url
 * @return string
 */
function smarty_modifier_url_format( $url )
{
	return str_replace( array( 'http://', 'www.' ), '', mb_strtolower($url) );
}

/* vim: set expandtab: */

?>
